package com.huluobo.h3kotlinproject.db

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.huluobo.h3kotlinproject.db.entity.UserInfo

/**
 *  Created by LC on 2023/10/20.
 */
@Dao
interface UserInfoDao {
    //插入
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertUserInfo(userInfo: UserInfo)

    @Update
    fun updateUserInfo(userInfo: UserInfo)

    @Query("select * from user_info where id =:userId")
    fun queryUserInfo(userId: Int): UserInfo

    @Delete
    fun deleteUserinfo(userInfo: UserInfo)
}